module("mywifi", package.seeall);

function wifiInit(ssid, pwd)
    wifi.setmode(wifi.STATION, false)
    --connect to Access Point (save config to flash)
    station_cfg={}
    station_cfg.ssid = ssid
    station_cfg.pwd = pwd
    --station_cfg.bssid="66:66:66:66:66:89"
    station_cfg.save=true
    wifi.sta.config(station_cfg)
end